import request from '../lib/index'

interface QueryInfo {
  pageNum: number,
  pageSize: number
}
interface AddTagForm {
  tag_name: string
}
interface DeleteTagForm {
  id: string
}
interface EditTagForm {
  id: string,
  tag_name: string
}
// 获取标签列表
const getTags = (data: QueryInfo) => {
  return request({
    url: '/tag/tagInfo',
    method: 'post',
    data
  })
}
// 新增标签
const addTag = (data: AddTagForm) => {
  return request({
    url: '/tag/add',
    method: 'post',
    data
  })
}
// 删除标签
const deleteTag = (data: DeleteTagForm) => {
  return request({
    url: '/tag/del',
    method: 'post',
    data
  })
}
// 修改标签
const editTag = (data: EditTagForm) => {
  return request({
    url: '/tag/edit',
    method: 'post',
    data
  })
}
export { getTags, addTag, deleteTag, editTag }